package com.zhang.apidriver.controller;

import com.zhang.apidriver.service.ApiDriverOrderInfoService;
import com.zhang.internalcommon.dto.OrderRequest;
import com.zhang.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 类功能描述
 *
 * @author Kye
 * @date 2025-04-20
 */
@RestController
@RequestMapping("/order")
public class OrderController {
	@Autowired
	private ApiDriverOrderInfoService orderInfoService;
	/**
	 * 接乘客
	 * @param orderRequest
	 * @return
	 */
	@PostMapping("/to-pick-up-passenger")
	public ResponseResult toPickUpPassenger(@RequestBody OrderRequest orderRequest) {
		return orderInfoService.toPickUpPassenger(orderRequest);
	}

	@PostMapping("/arrived-departure")
	public ResponseResult arrivedDeparture(@RequestBody OrderRequest orderRequest){
		return orderInfoService.arrivedDeparture(orderRequest);
	}

	@PostMapping("/pick-up-passenger")
	public ResponseResult pickUpPassenger(@RequestBody OrderRequest orderRequest){
		return orderInfoService.pickUpPassenger(orderRequest);
	}

	@PostMapping("/passenger-getoff")
	public ResponseResult passengerGetoff(@RequestBody OrderRequest orderRequest){
		return orderInfoService.passengerGetoff(orderRequest);
	}

	@PostMapping("/cancel")
	public ResponseResult cancelOrder(@RequestParam Long orderId) {
		return orderInfoService.cancelOrder(orderId);
	}
}
